﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Barbar.UrlGuard.Controls;
using Barbar.UrlGuard.BL;
using System.Reflection;

namespace Barbar.UrlGuard {
  public partial class FormAbout : LocalizableForm, ILocalizable {
    public FormAbout() {
      InitializeComponent();
    }

    #region ILocalizable Members

    public void Localize(ILocalizator localizator) {
      if (localizator == null)
        throw new ArgumentNullException("localizator");
      Text = localizator.Translate("FormAbout_Title");
    }

    #endregion

    protected override void OnLoad(EventArgs e) {
      base.OnLoad(e);
      lblVersion.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString(4);
    }

    private void btnClose_Click(object sender, EventArgs e) {
      Close();
    }

    private void lblProductUrl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
      IBrowserProvider provider = ServiceLocator.Instance.Resolve<IBrowserProvider>();
      provider.OpenUrl(lblProductUrl.Text);
    }
  }
}
